<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<input type="checkbox" name="fun1">运动
<input type="checkbox" name="fun2">唱歌
<input type="checkbox" name="fun3">写代码

<input type="checkbox">全选
<script>
  var funs2 = document.getElementsByTagName('input');
  var funs = document.querySelectorAll('input[name="fun"]');
  console.log(funs2[0]);
  console.log(Object.prototype.toString.call(funs2).slice(8, -1));
  //  var arr = [];
  //
  // for(var i=0;i<funs.length;i++){
  //     arr.push(funs[i])
  // }
  // console.log(arr)

  // var arr = Array.from(funs)
  // console.log(arr)


  /*
      扩展运算符 ...

      以参数的形式，进行扩展
      参数形式：arr1,arr2,arr3
  */

  var arr = [...funs];
  var arr2 = [funs[0], funs[1], funs[2]];
  console.log(arr2)


  // var arr = Array.prototype.slice.call(funs);
  // console.log(arr)

  //var arr2 = [10,20,30]
  // var arr3 = arr2.slice(0,2);
  // var arr3 = arr2.slice();
  // console.log(arr3);


  // Array.prototype.slice.call(funs)


</script>
</body>
</html>